// 登录模块状态管理
import { Module } from 'vuex'

import { RootState } from '../index'
export interface LoginState {
    token: string,
}
export const login: Module<LoginState, RootState> = {
    namespaced: true,
    state: {
        token: '',
    },
    mutations: {
        setToken(state, token) {
            state.token = token;
        }
    }
    ,
    actions: {
        setToken({ commit }, token) {
            commit('setToken', token);
        }
    },
}
export default login;
export type LoginMutations = typeof login.mutations;  // 导出 mutations 类型
export type LoginActions = typeof login.actions;      // 导出 actions 类型


